﻿namespace HRM.CORE
{
    using Dictionary.ERP;
    using HRM.CORE;
    using System; using Extra.ERP;
    using System.ComponentModel;

    public class Organization
    {
        private string m_BranchCode;
        private string m_Code;
        private string m_DepartmentCode;
        private string m_EmployeeCode;
        private string m_GroupCode;
        private int m_Level;

        public Organization()
        {
            this.m_BranchCode = "";
            this.m_DepartmentCode = "";
            this.m_GroupCode = "";
            this.m_EmployeeCode = "";
            this.m_Level = 0;
            this.m_Code = "";
        }

        public Organization(string BranchCode, string DepartmentCode, string GroupCode, string EmployeeCode, int Level, string Code)
        {
            this.m_BranchCode = BranchCode;
            this.m_DepartmentCode = DepartmentCode;
            this.m_GroupCode = GroupCode;
            this.m_EmployeeCode = EmployeeCode;
            this.m_Level = Level;
            this.m_Code = Code;
        }

        [DisplayName("BranchCode"), Category("Column")]
        public string BranchCode
        {
            get
            {
                return this.m_BranchCode;
            }
            set
            {
                this.m_BranchCode = value;
            }
        }

        [DisplayName("Code"), Category("Column")]
        public string Code
        {
            get
            {
                return this.m_Code;
            }
            set
            {
                this.m_Code = value;
            }
        }

        [Category("Column"), DisplayName("DepartmentCode")]
        public string DepartmentCode
        {
            get
            {
                return this.m_DepartmentCode;
            }
            set
            {
                this.m_DepartmentCode = value;
                HRM_DEPARTMENT hrm_department = new HRM_DEPARTMENT();
                hrm_department.Get(this.m_DepartmentCode);
                this.m_BranchCode = hrm_department.BranchCode;
            }
        }

        [Category("Column"), DisplayName("EmployeeCode")]
        public string EmployeeCode
        {
            get
            {
                return this.m_EmployeeCode;
            }
            set
            {
                this.m_EmployeeCode = value;
            }
        }

        [Category("Column"), DisplayName("GroupCode")]
        public string GroupCode
        {
            get
            {
                return this.m_GroupCode;
            }
            set
            {
                this.m_GroupCode = value;
                HRM_GROUP hrm_group = new HRM_GROUP();
                hrm_group.Get(this.m_GroupCode);
                this.m_DepartmentCode = hrm_group.DepartmentCode;
                HRM_DEPARTMENT hrm_department = new HRM_DEPARTMENT();
                hrm_department.Get(this.m_DepartmentCode);
                this.m_BranchCode = hrm_department.BranchCode;
            }
        }

        [DisplayName("Level"), Category("Column")]
        public int Level
        {
            get
            {
                return this.m_Level;
            }
            set
            {
                this.m_Level = value;
            }
        }
    }
}

